package com.zlcx.tz.live.client;

import com.zlcx.tz.live.client.vo.LiveGatherVO;
import com.zlcx.tz.live.common.config.OauthFeignConfig;
import com.zlcx.tz.live.vo.*;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;

/**
 * <p></p>
 * <PRE></PRE>
 * <BR>    修改记录
 * <BR>-----------------------------------------------
 * <BR>    修改日期         修改人          修改内容
 *
 * @author zl
 * @version 1.0
 * @date Created in 2019/4/18 11:07
 * @copyright: Copyright (c) founders
 */
@FeignClient(name = "tz-user-center", configuration = OauthFeignConfig.class)
public interface UserClient {

    @GetMapping(value = "/users/{id}")
    ResultVO<UserVO> getUserInfo(@PathVariable("id") Long userId);

    /**
     * 该方法不走缓存，直接返回用户实时信息，如果需要判断状态的地方可以使用
     */
    @GetMapping(value = "/users/find-one/{id}")
    ResultVO<UserVO> findOne(@PathVariable("id") Long userId);

    /**
     * 用户id集合查询用户信息
     */
    @PostMapping("/users/list")
    ResultVO<List<UserVO>> list(@ApiParam(value = "用户id集合") @RequestBody List<Long> idList);

    /**
     * 用户id集合查询用户信息(内部用-无缓存)
     */
    @PostMapping("/users/list/newest")
    ResultVO<List<UserVO>> find(@ApiParam(value = "用户id集合") @RequestBody List<Long> idList);


    @PostMapping(value = "/study/user/add/timing")
    ResultVO addUserLearnTime(@RequestBody LearnTimeParamVO usersStudyInfoVO);

    @GetMapping(value = "/users/send/verify/code")
    ResultVO sendEmsMsg(@RequestParam("phoneStr") String phoneStr,@RequestParam("reportContent") String reportContent,@RequestParam(value = "params", required = false) ArrayList<String> params);

    @PutMapping(value = "/users/{id}")
    ResultVO updateUserInfo(@PathVariable("id") Long userId,@RequestBody UserParamVO editVO);

    /**
     * 判断是否能连麦

    @GetMapping("/vip/check")
    ResultVO<VipUserVO> checkVip(@ApiParam(required = true) @RequestParam("userId") Long userId);*/

    @GetMapping("/vip/gather")
    ResultVO<LiveGatherVO> gather(@ApiParam(required = true) @RequestParam("userId") Long userId);

    /**
     * 是否是vip

    @GetMapping("/vip/info")
    ResultVO<VipUserVO> getVipInfo(@ApiParam(required = true) @RequestParam("userId") Long userId);*/

    @GetMapping("/study/live/total/time")
    ResultVO<Integer> totalLiveMinute(@ApiParam(required = true) @RequestParam("userId") Long userId);

    @GetMapping("/learn/content/list/personal")
    ResultVO<List<LearnContentVO>> getContentList(@RequestParam("userId") Long userId);

    @PutMapping("/users/online/friends")
    ResultVO<List<UserVO>> findOnlineFriends(@RequestParam("userId") Long userId);
}